
<?php //Mostrar participants si n'hi han
echo "<table>";
if ($comanda->comandaNumLines>0) {

    $total=0;
    foreach($lines as $linia): 
        echo "<tr>";
        $total= $total + $linia->liniaProducte->preu*$linia->quantitat;
        echo "<td>".CHtml::link(CHtml::image('images/icons/delete.png','Esborrar'),
            array('#'), 
            array('submit'=>array('comandalin/delete',
                'id'=>$linia->id,
                'com'=>$comanda->id),
                'confirm'=>'Segur que vols esborrar el producte "'.
                $linia->liniaProducte->descripcio.'"?'))."</td>";
        echo "<td><h3>".$linia->quantitat."</h3></td>";
        echo "<td>";
        echo CHtml::encode($linia->liniaProducte->descripcio);
        echo ($linia->observacions!=NULL ? ', ' : ' ');
        echo CHtml::encode($linia->observacions);
        echo " (".Yii::app()->NumberFormatter->formatCurrency($linia->liniaProducte->preu*$linia->quantitat,"EUR").")";
        echo "</td>";
        echo "</tr>";
    endforeach;
    echo "</table>";
    echo "<h2>Total a pagar: ".Yii::app()->NumberFormatter->formatCurrency($total, "EUR")."</h2>"; 
} ?>